<template>
  <div>
    <BasicModal :width="800" title="申请免费证书" @register="registerCertificateModal">
      <BasicForm @register="registerForm">
        <template #valid>添加TXT类型解析 </template>
      </BasicForm>
    </BasicModal>
  </div>
</template>
<script lang="ts" setup>
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { BasicForm, FormSchema, useForm } from '/@/components/Form';

  const schemas: FormSchema[] = [
    {
      field: '',
      component: 'RadioGroup',
      label: '证书类型：',
      defaultValue: 1,
      componentProps: {
        options: [
          { label: '单域名证书', value: 0 },
          { label: '多域名通配符证书（仅支持顶级域名）', value: 1 },
        ],
      },
    },
    {
      field: '',
      component: 'Input',
      label: '验证方式：',
      slot: 'valid',
    },
    {
      field: 'dimond',
      component: 'InputTextArea',
      label: '域名：',
      componentProps: {
        placeholder: '请输入域名，多个请换行，格式如下：www.123.com,123.com',
        rows: 5,
      },
    },
  ];
  const [registerCertificateModal] = useModalInner();
  const [registerForm] = useForm({
    schemas,
    showActionButtonGroup: false,
    baseColProps: { span: 22 },
    labelWidth: 120,
  });
</script>
